package com.heny.demo;

import com.heny.demo.service.FileImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class TurnPointController {
    @Autowired
    FileImportService importService;

    @PostMapping("/upload")
    public Boolean uploadTurnPoint(MultipartFile turnPointFile) {
        try {
            importService.importFile(turnPointFile);
            return Boolean.TRUE;
        } catch (Exception e) {
            return Boolean.FALSE;
        }
    }
}